import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/route_manager.dart';
import 'package:oktoast/oktoast.dart';
import 'package:smart_lam/config/storage_manage.dart';
import 'package:smart_lam/routes/app_pages.dart';
import 'package:smart_lam/theme/app_theme.dart';

void main() async{
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
    systemNavigationBarColor: Colors.transparent,
    statusBarColor: Colors.transparent,
    systemNavigationBarIconBrightness: Brightness.dark,
    statusBarBrightness: Brightness.dark,
    statusBarIconBrightness: Brightness.dark,
  ));
  await StorageManager().init();
  runApp(MyApp());
}
 
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return OKToast(
      child: ScreenUtilInit(
        designSize: Size(414, 736),
        builder: () =>
           GetMaterialApp(
            debugShowCheckedModeBanner: false,
            initialRoute: '/home',
            title: '氛围灯',
            theme: appThemeData,
            defaultTransition: Transition.rightToLeft,
            transitionDuration: Get.defaultTransitionDuration,
            enableLog: true,
            getPages: AppPages.pages,
          )
      )
    );
  }
}